package com.wsl.redis.Controller;

import com.wsl.entity.Person;
import com.wsl.redis.domain.PersonDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:WangShuliang
 * @Description:
 * @Date:Created in 9:33 2017/12/1
 * @Modified by:
 */
@RestController
public class DataController {
    @Autowired
    PersonDao personDao;
    @RequestMapping("/set")
    public void set(Person person){
        personDao.save(person);
        personDao.stringRedisTemplate("wsl","goodboy");
    }
    @RequestMapping("/getString")
    public  String  getString(String key){
      return   personDao.getString(key);
    }
}